clc;clear;
wrdLn = 15; quant_num = 10000;

u = double(fi(1023+1023i, 1, wrdLn));
x = real(u); y = imag(u); z = 0;
fprintf('输入x:%d;输入y:%d\n',x,y);

for iter=0:wrdLn-1
    angle = quant_num*180/pi*atan(2^(-iter));
    if (y > 0)
        new_x = x + y*(2^(-iter));
        new_y = y - x*(2^(-iter));
        z = z + angle;
    else
        new_x = x - y*(2^(-iter));
        new_y = y + x*(2^(-iter));
        z = z - angle;
    end
    x = new_x;
    y = new_y;
end
fprintf('1023*1.414/0.6072=%d\n',int16(1023*1.414/0.6072));
fprintf('输出模:%d;输出角度:%d\n',int16(new_x),int32(z));
v = x + z*1i;
